Skip to content

Conversation

@nordic-krch
Copy link
Contributor

It is not needed to use always the system work queue to send a message over IPC. In thread context IPC service can be called directly. It speeds up the communication and allows to use nrfs from the system work queue. Legacy approach could easily lead to the deadlock if user would call nrfs from work queue and pend on semaphore until response is received.

kl-cruz
kl-cruz previously approved these changes Nov 26, 2024
@nordic-krch
Copy link
Contributor Author

@hubertmis @anangl take a look? Without this nrfs cannot be called from workq context (and this context is used by runtime PM).
@kl-cruz I had to rebase, can you reapprove?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't && nrfs_backend_connected() be added here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@hubertmis
Copy link
Member

This change seems to be changing the properties of the nrfs_backend_send_ex() function from non-blocking to blocking. I don't know this module well enough to assess if that's ok. So I would prefer someone else, who knows the module better, to review

Copy link
Contributor

@nika-nordic nika-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lack of this PR functionally breaks all drivers that utilize pm_device_runtime_put_async from ISR context (for example SPIM)

It is not needed to use always the system work queue to send a
message over IPC. In thread context IPC service can be called
directly. It speeds up the communication and allows to use nrfs
from the system work queue. Legacy approach could easily lead
to the deadlock if user would call nrfs from work queue and
pend on semaphore until response is received.

Signed-off-by: Krzysztof Chruściński <[email protected]>
@kartben kartben merged commit 4615890 into zephyrproject-rtos:main Dec 13, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: nRF Nordic nRFx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants